// /**
//  * 注册、登录、退出相关api
//  */

import http from '@/utils/request'
import { HR_HOST } from './server'

/**
 * 体验考试系统申请
 * @param {*} data
 */
export function sendCompanyInfo(data) {
  return http({
    url: `${HR_HOST}/statistics/application`,
    method: 'POST',
    data
  })
}

/**
 * 提交完善企业信息
 * @param {*} data
 */
export function submitCompayInfo(data, headers) {
  return http({
    url: '/demo/enterprise/addEntInfo',
    method: 'POST',
    data,
    headers
  })
}

// 超管服务
import { SUPER_MANAGE_HOST } from './server'
export function login(data) {
  return http({
    url: `${SUPER_MANAGE_HOST}/operator/login`,
    method: 'POST',
    data: data
  })
}
export function get_user_info() {
  return http({
    url: `${SUPER_MANAGE_HOST}/operator/info`,
    method: 'GET'
  })
}
export function get_user_permission() {
  return http({
    url: `${SUPER_MANAGE_HOST}/permission/my`,
    method: 'GET'
  })
}

export function get_user_roles() {
  return http({
    url: `${SUPER_MANAGE_HOST}/role/my`,
    method: 'POST'
  })
}

export function get_all_roles() {
  return http({
    url: `${SUPER_MANAGE_HOST}/role/all`,
    method: 'GET'
  })
}

// 注册
export function companyRegister(data) {
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/company/register`,
    method: 'POST',
    data: data
  })
}

export function getValidateCode() {
  // 获取图片验证码
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/validate_code`,
    method: 'GET'
  })
}

export function sendSMS(data) {
  // 发送注册短信
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/sms/send/register`,
    method: 'POST',
    data: data
  })
}

export function sendLoginSMS(data) {
  // 发送登录短信
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/sms/send/login`,
    method: 'POST',
    data: data
  })
}

export function resetPwd(data) {
  // 重置密码
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/visitor/password/reset`,
    method: 'POST',
    data: data
  })
}

export function sendResetPwdSMS(data) {
  // 发送重置密码短信
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/sms/send/password`,
    method: 'POST',
    data: data
  })
}

export function registerAdmin(data) {
  // 注册管理员
  return http({
    url: `${SUPER_MANAGE_HOST}/ent/operator/register`,
    method: 'POST',
    data: data
  })
}

export function removeOperator(operatorUuid) {
  // 删除管理员
  return http({
    url: `${SUPER_MANAGE_HOST}/operator/remove/${operatorUuid}`,
    method: 'GET'
  })
}
